package com.step.core.controller;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import com.stepshop.sys.bean.SysArea;
import com.stepshop.sys.service.SysAreaService;

@Controller
@RequestMapping("/core/")
public class CoreController {
	@Resource
	private SysAreaService sysAreaService;
	@RequestMapping("getUser")
	@ResponseBody
	public Map<String,Object> getUser(HttpServletRequest request,HttpServletResponse response){
		Map<String,Object> map=new HashMap<String,Object>();
		//获取request方式 1
//		HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder
//				.getRequestAttributes()).getRequest();
//		String path = request.getSession().getServletContext().getRealPath("/");
//		System.out.println(path);
		SysArea area=new SysArea();
		sysAreaService.saveArea(area);
		map.put("stutus","success");
		return map;
	}
}
